<template>
    <a-config-provider :locale="locale">
        <component :is="layout" style="height: 100vh;">
            <!-- <pc-layout></pc-layout> -->
            <router-view></router-view>
        </component>
    </a-config-provider>
</template>

<script>
import pcLayout from './layouts/pc.vue';
import emptyLayout from './layouts/empty.vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

dayjs.locale('zh-cn');

const resizeObserverErr = window.onerror;
window.onerror = function(err) {
  if (err.includes('ResizeObserver')) {
    return false; // 忽略 ResizeObserver 相关错误
  }
  return resizeObserverErr(...arguments);
};

export default {
    components: { pcLayout, emptyLayout },
    data() {
        return {
            locale: zhCN
        };
    },
    computed: {
        layout() {
            let lay = (this.$route.meta.layout || "pc") + "-layout";
            return lay;
        },
    },
    methods: { },
    mounted() { },
};
</script>

<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* text-align: center; */
    color: #2c3e50;
    height: 100vh;
}

nav {
    padding: 30px;
}

nav a {
    font-weight: bold;
    color: #2c3e50;
}

nav a.router-link-exact-active {
    color: #42b983;
}
</style>
